import socket

HOST='127.0.0.1'
PORT=3434

s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)

data="王镜涵"
s.sendto(bytes(data,encoding='utf-8'),(HOST,PORT))
print("发送了数据")
s.close()